<template>
  <view class="nothing" v-if="list.length === 0">
    <view class="text">您还没有添加任何商品到购物车</view>
    <view class="btn" @click="goHome">
      <view class="b">去逛逛</view>
    </view>
  </view>
</template>

<script>
export default {
  props: ['list'],
  methods: {
    goHome() {
      this.$store.dispatch('Url/set_url', '/pages/index/index?type=0')
    }
  }
}
</script>

<style scoped lang="scss">
.nothing {
  font-size: 24rpx;
  padding: 20rpx;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .text {
    text-align: center;
    font-size: 28rpx;
    color: #999999;
  }
  .btn {
    display: flex;
    justify-content: center;
    margin-top: 30rpx;
    .b {
      padding: 10rpx 25rpx;
      background: $main_color;
      border-radius: 20rpx;
      color: white;
      font-size: 24rpx;
    }
  }
}
</style>
